php forum
php mysql forum
php mysql smarty
 
Page 1 of 2 1 2 >
Topic Options
#312664 - 01/13/07 06:36 PM [7.1] Forum Stats: Posts in the last 24 hours.
Ian Spence Offline
Master Hacker

Registered: 01/25/03
Posts: 3765
Loc: Saint Johns, PA
By: Ian Spence and gliderdad79

This is only for version 7.1 and greater

In /cache_builders/forum_stats.php
Find:
Code:
$smarty->assign("maxonline",$maxonline);


Add before:
Code:
$query = "
	SELECT count(POST_ID)
	FROM {$config['TABLE_PREFIX']}POSTS
	WHERE POST_POSTED_TIME > ?
";

$sth = $dbh->do_placeholder_query( $query, array( $html->get_date() - 86400 ), __LINE__, __FILE__ );
list( $posts_24hrs ) = $dbh->fetch_array( $sth );

$smarty->assign("recentposts", $posts_24hrs );


In /languages/english/portal_islands.php
Find:
Code:
$ubbt_lang['TOP_POSTERS'] = "Top Posters";


Add after:
Code:
$ubbt_lang['POST_24HRS'] = "posts in the last 24hrs";


In /templates/default/island_forum_stats.tpl
Find:
Code:
<b>{$posts}</b> <?php echo $ubbt_lang['POSTS'] ?>


Add after:
Code:
<b>{$recentposts}</b> <?php echo $ubbt_lang['POST_24HRS'] ?>




Edited by Ian Spence (01/14/07 10:10 AM)

Top
#312667 - 01/14/07 04:04 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Ian Spence]
gliderdad79 Offline
User

Registered: 03/24/06
Posts: 31
Thank you Ian for taking the time to re write this for 7.1 it is much appreciated thumbsup

Top
#312670 - 01/14/07 09:28 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: gliderdad79]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
cool, thanks smile
_________________________
- Allen wavey
- What Drives You?

Top
#312673 - 01/14/07 07:24 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: AllenAyres]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Lookin Good wink
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#312684 - 01/15/07 02:42 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Gizmo]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
Thanks Ian smile
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#312686 - 01/15/07 06:22 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Ian_W]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
not sure what I have done wrong, as it is straight forward - but it is not working for me.
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#312688 - 01/15/07 06:25 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Ian_W]
gliderdad79 Offline
User

Registered: 03/24/06
Posts: 31
I havent been able to try it as I don't have 7.1 yet

Top
#312690 - 01/15/07 06:36 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: gliderdad79]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
ignore me - redone it, and it is fine - not sure what I did wrong - but cleared the cache a couple of times and it is fine. Weird.
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#312695 - 01/15/07 07:01 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Ian_W]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Don't mind Ian, he's a PEBKAC lol
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#312704 - 01/15/07 09:29 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Gizmo]
gliderdad79 Offline
User

Registered: 03/24/06
Posts: 31
Thanks for the link to pebkac, after reading what it is I am dying over here.

Top
#312715 - 01/15/07 07:06 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: gliderdad79]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I think everyone should have that as an "ActiveText" for the word "Dolt" lol
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313274 - 02/25/07 07:56 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Gizmo]
Mark_S Offline
Power User

Registered: 11/15/03
Posts: 86
Loc: UK
Cheers Ian works a treat wink

Top
#313402 - 03/05/07 09:08 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Mark_S]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Grazi, works well smile
_________________________
- Allen wavey
- What Drives You?

Top
#314625 - 06/28/07 01:40 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: AllenAyres]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
Works fine in 7.2 smile
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#314629 - 06/29/07 01:00 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Ian_W]
gliderdad79 Offline
User

Registered: 03/24/06
Posts: 31
Thanks Ian for letting us know. Trying to figure out which I am hacks gona need to rework on my site. Glad to hear it works and it dont need reworking laugh

Top
#314764 - 07/17/07 03:09 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: gliderdad79]
Zarzal Offline
Coder

Registered: 07/03/01
Posts: 811
Loc: Berlin, Germany
Yes, works for me too.
_________________________
my forum: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de

Top
#315820 - 09/25/07 05:04 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Gizmo]
MattUK Offline
Journeyman

Registered: 11/23/01
Posts: 137
Originally Posted By: Gizmo
Don't mind Ian, he's a PEBKAC lol


I always prefered PICNIC

Problem In Chair Not In Computer

Top
#315964 - 10/06/07 09:26 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: MattUK]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 137
Loc: Columbus, OH
Is this mod supposed to be instant, or will it appear after 24 hours?
http://riddledindarkness.com/hprpg/ubbthreads.php?ubb=cfrm

Top Right corner of the page
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#315970 - 10/07/07 03:43 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: AshtarRose]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
should be instant - best bet is to clear your cache if it is not displaying straight away.
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#315971 - 10/07/07 09:15 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Ian_W]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Also make sure that you've applied the language portions as it seems to hang there.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#315974 - 10/07/07 10:31 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Gizmo]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 137
Loc: Columbus, OH
I applied the language portion, it appears to be working
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#316720 - 02/15/08 05:51 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: AshtarRose]
gliderdad79 Offline
User

Registered: 03/24/06
Posts: 31
This is working in 7.3b4 with one small change.

In /cache_builders/forum_stats.php

7.1 - 7.2 you would search for
Code:
$smarty->assign("maxonline",$maxonline);


For 7.3b4 you will search for this instead
Code:
$smarty->assign("maxonline", $cache['max_online']); 



Top
#316734 - 02/19/08 02:42 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: gliderdad79]
Mark_S Offline
Power User

Registered: 11/15/03
Posts: 86
Loc: UK
Excellent smile

Top
#317083 - 05/28/08 07:06 PM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Gizmo]
willing Offline
User

Registered: 04/17/07
Posts: 42
I'd like to use this - where exactly will this appear? (Any screenshots?)

Thank you!

Top
#317087 - 05/29/08 02:47 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: willing]
Ian_W Offline

Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
It is showing in the footer of my forums.

http://www.fansfocus.com

_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#317088 - 05/29/08 03:47 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Ian_W]
willing Offline
User

Registered: 04/17/07
Posts: 42
Looks good - will see to that I think!

Thanks

Top
#317089 - 05/29/08 04:16 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Gizmo]
willing Offline
User

Registered: 04/17/07
Posts: 42
Great! It works smile

thank you

Top
#317109 - 05/31/08 01:54 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: willing]
willing Offline
User

Registered: 04/17/07
Posts: 42
Here's another that would be good:

Average number of posts per day

I suppose (perhaps incorrectly) that that might be a a fairly simple addition (?)

Top
#317114 - 05/31/08 06:20 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: willing]
Carte Blanche Offline
Newbie

Registered: 10/08/06
Posts: 21
Loc: Auckland, NZ
Probably, just would need to define the length of time you'd go back to do your averaging over and also decide if you'd want to show decimals or use modulo to determine whether you should round up or down if you're just looking for integer values.

Top
#317115 - 05/31/08 06:53 AM Re: [7.1] Forum Stats: Posts in the last 24 hours. [Re: Carte Blanche]
Carte Blanche Offline
Newbie

Registered: 10/08/06
Posts: 21
Loc: Auckland, NZ
See the Average Daily Post count topic I'm creating for the "how to" here


Edited by Carte Blanche (05/31/08 07:22 AM)

Top
Page 1 of 2 1 2 >



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks